<%@ page language="java" import="java.util.*,java.text.*"
	pageEncoding="utf-8"%>
<%@page import="student.Student"%>
<%@page import="student.StudentDao"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'showAllStudents.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
</head>

<body>
	<%
		StudentDao stuDao=new StudentDao();
	   	List<Student> list=new ArrayList<Student>();
		list=stuDao.showAllStudents();
		out.print("<div align='center'><table border='1px' cellspacing='0px' style='text-align:center;border-collapse:collapse'>");
		out.print("<tr><th>编号</th><th>姓名</th><th>性别</th><th>电话</th><th>QQ</th>"+
		"<th>微信</th><th>年级</th><th>入学日期</th><th>来自哪个城市</th><th>生日</th><th>地址</th><th>密码</th><th>最后一次考试</th></tr>");
	   	for(Student s:list)
	   	{
	 	out.print("<tr><td>"+s.getStuno()+"</td><td>"+s.getSname()+"</td><td>"+s.getSex()+"</td><td>"+s.getTelephone()
	 	+"</td><td>"+s.getQq()+"</td><td>"+s.getWechat()+"</td><td>"+s.getGradeid()+"</td><td>"
	 	+s.getEnterdate()+"</td><td>"+s.getFromcity()+"</td><td>"+s.getBirthday()+"</td><td>"
	 	+s.getAddress()+"</td><td>"+s.getPass()+"</td><td>"+s.getLast_exam()+"</td></tr>");

	   	}
		out.print("</table></div>");
	%>
</body>
</html>